<template>
  <div class="container">
    <InsuranceForm v-if="current_step===1" @submitForm="submitForm" />
    <InsuranceRecommend v-if="current_step===2" :form-data="formData" @back="backForm" />
  </div>

</template>

<script>
import InsuranceForm from './components/InsuranceForm.vue';
import InsuranceRecommend from './components/InsuranceRecommend.vue';
import * as api from './api.js';

export default {
  name: 'InsuranceAgent',
  components: { InsuranceForm, InsuranceRecommend },
  data() {
    return {
      current_step: 1,
      formData: {},
    };
  },
  created() {},
  async mounted() {
    await this.$confirm(
      `这里提供的保险产品分析、对比及推荐内容是基于公开资料及一般性经验，不代表专业投保建议，不构成投保要约，仅供员工参考，表达工会对员工的关心关怀。`,
      '免责声明',
      {
        confirmButtonText: '确认',
        cancelButtonText: '取消',
        type: 'warning',
      }
    );
  },
  methods: {
    submitForm(form) {
      this.current_step = 2;
      this.formData = form;
    },
    backForm() {
      this.current_step = 1;
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  padding: 20px;
  background-color: #f7f8fa;
  min-height: calc(100vh - 84px);
  font-family: 'Alibaba PuHuiTi 3.0';
  color: #3d3d3d;
}
</style>
